<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Edit</title>
<style type="text/css">
<!--
a:link {
	text-decoration: none;
	color: #FFFF99
}

a:visited {
	text-decoration: none;
	color: #FFFF99
}

a:hover {
	color: skyblue
}
-->
</style>
</head>
<body background="images/gradient.png" bgproperties="fixed">
	<!-- <h1>EDIT</h1> -->
	<div align="center">
		<img src="images/header.png">
	</div>
	<div align="center">
		<table width="1000" bgcolor="#4956B1">
			<tr>
				<%
					if (session.getAttribute("username") == null) {
				%>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="home.jsp">&nbsp;&nbsp;HOME&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="register.jsp">&nbsp;&nbsp;REGISTRAZIONE&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="search.jsp">&nbsp;&nbsp;RICERCA&nbsp;&nbsp;</a></b></font></td>
				<td></td>
				<%
					} else {
				%>
				<%
					if (session.getAttribute("admin") == null) {
				%>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="home.jsp">&nbsp;&nbsp;HOME&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./MyProfile">&nbsp;&nbsp;PROFILO&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./Friends">&nbsp;&nbsp;AMICI&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./FriendshipReqs">&nbsp;&nbsp;AMICIZIE&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./HelpReqs">&nbsp;&nbsp;AIUTI&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./SkillReqs">&nbsp;&nbsp;ABILITA'&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="search.jsp">&nbsp;&nbsp;RICERCA&nbsp;&nbsp;</a></b></font></td>
				<td></td>
				<td align="right" valign="middle" width="150" height=""><font
					face="tahoma" color="#FFFF99" size="2">&nbsp;&nbsp;Ciao, <%=session.getAttribute("username")%>!
						<a href="./Logout"><b>LOGOUT&nbsp;&nbsp;</b></a></font></td>
				<%
					} else {
				%>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="home.jsp">&nbsp;&nbsp;HOME&nbsp;&nbsp;</a></b></font></td>
				<td align="center" valign="middle" width="50" height=""><font
					face="tahoma" color="#FFFF99" size="2"><b><a
							href="./SkillReqs">&nbsp;&nbsp;ABILITA'&nbsp;&nbsp;</a></b></font></td>
				<td></td>
				<td align="right" valign="middle" width="200" height=""><font
					face="tahoma" color="#FFFF99" size="2">&nbsp;&nbsp;Benvenuto,
						<%=session.getAttribute("username")%>! <a href="./Logout"><b>LOGOUT&nbsp;&nbsp;</b></a>
				</font></td>
				<%
					}
				%>
				<%
					}
				%>
			</tr>
		</table>
	</div>
	<div align="center">
		<table width="1000" bgcolor="#FFFFFF">
			<tr>
				<td>
					<table border="1" bordercolor="#0B0B44">
						<tr>
							<td align="center" bgcolor="#5588FF"><font face="tahoma"
								size="3" color="white"><b>MODIFICA PROFILO</b></font></td>
						</tr>
						<tr>
							<td align="center">
								<form method="post" action="./Edit">
									<table>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Username</font></td>
											<td width="215"><input type="text" name="username"
												value="<%=session.getAttribute("username")%>" disabled></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Password*</font></td>
											<td width="215"><input type="password" name="password"
											    value="<%=request.getParameter("password")%>"></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Ripeti Password*</font></td>
											<td width="215"><input type="password" name="pswControl"
											    value="<%=request.getParameter("password")%>"></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">E-Mail*</font></td>
											<td width="215"><input type="text" name="email"
												value=<%=request.getParameter("email")%>></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Nome*</font></td>
											<td width="215"><input type="text" name="name"
												value=<%=request.getParameter("name")%>></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Cognome*</font></td>
											<td width="215"><input type="text" name="surname"
												value=<%=request.getParameter("surname")%>></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Data di Nascita (AAAA-MM-GG)</font></td>
											<td width="215"><input type="text" name="birth"
												value=<%if (!request.getParameter("birth").equals("null")) {%>
												<%=request.getParameter("birth")%> <%}%>></td>
										</tr>
										<tr>
											<td align="right" width="235"><font face="tahoma"
												size="2">Indirizzo</font></td>
											<td width="215"><input type="text" name="address"
												value=<%if (!request.getParameter("address").equals("null")) {%>
												<%=request.getParameter("address")%> <%}%>></td>
										</tr>
										<tr>
											<td align="right" width="235"></td>
											<td width="215"><font face="tahoma" size="2">*Campo
													obbligatorio</font></td>
										</tr>
										<tr>
											<td align="right" width="235"></td>
											<td width="215"><input type="submit"></td>
										</tr>
									</table>
								</form>
							</td>
						</tr>
					</table>
				</td>
				<%
					if (session.getAttribute("username") == null) {
						response.sendRedirect("home.jsp");
					} else {
				%>
				<td valign="top" width="250" bgcolor="E3E8F2"></td>
				<%
					}
				%>
			</tr>
		</table>
	</div>
	<div align="center">
		<table width="1000" bgcolor="#4956B1">
			<tr>
				<td align="center" valign="middle" height=""><font
					face="tahoma" size="2" color="#FFFF99">Copyright © 2012-2013
						&nbsp;&nbsp; Eric De Marco - Giulia Busnelli &nbsp; Tutti i
						diritti riservati</font></td>
			</tr>
		</table>
	</div>
</body>
</html>